{% extends "base.html" %}
{% block content %}
<div class="main">
	<div class="row">
		<div class="col-md-12">
			<div class="text-wrap">
				NMAP TCP SCAN
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="input-group input-group-lg">
				<input type="text" id="target" class="form-control" aria-label="..." name="domain">
				<div class="input-group-btn">
					<button type="button" id="nmap" class="btn btn-info btn-lg search-btn" aria-haspopup="true" aria-expanded="false"><b>SCAN</b></button>
				</div>
			</div>
		</div>
    </div>
    <div class="row main-panel">
        <div class="col-md-1"></div>
			<div class="col-md-10">
				<div id="colo" class="panel panel-primary">
                    <div class="panel-heading" id="ti">提示：</div>
                        <div class="panel-body" id="notice" style="word-wrap:break-word; word-break:break-all;display:block">
						    最简单的nmap扫描
					    </div>

                </div>
			</div>
    </div>
    <div class="row">
		<div class="col-md-10">
			<div class="text-wrap">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
		</div>
	</div>
</div>
<script>
nmap_api="/api/nmap"
function request(target){
    $("#colo").removeClass("panel-primary").addClass("panel-success")
    $('#notice').html("请稍等...")
    $.post(nmap_api,JSON.stringify({"target":target}),function (results){
    	    $('#notice').html("<pre>"+results.data+"</pre>")
    },"json");
}
$(function() {
    $('#nmap').click(function() {
            request($("#target").val())
    });
});
</script>
{% endblock %}